part of 'bloc.dart';

class SpacedRepetitionPageBlocState {
  const SpacedRepetitionPageBlocState({
    required this.currentCardInfo,
    required this.previousCardInfo,
    required this.dialect,
    required this.autoPronunciationEnabled,
    required this.trainingSize,
    required this.pickedTrainableLexicalItemIds,
  });

  final CardInfo currentCardInfo;
  final CardInfo? previousCardInfo;
  final Dialect dialect;
  final bool autoPronunciationEnabled;
  final int trainingSize;
  final BuiltSet<String> pickedTrainableLexicalItemIds;

  SpacedRepetitionPageBlocState copyWith({
    CardInfo Function()? currentCardInfo,
    CardInfo? Function()? previousCardInfo,
    Dialect Function()? dialect,
    bool Function()? autoPronunciationEnabled,
    int Function()? trainingSize,
    BuiltSet<String> Function()? pickedTrainableLexicalItemIds,
  }) {
    return SpacedRepetitionPageBlocState(
      currentCardInfo: currentCardInfo == null ? this.currentCardInfo : currentCardInfo(),
      previousCardInfo: previousCardInfo == null ? this.previousCardInfo : previousCardInfo(),
      dialect: dialect == null ? this.dialect : dialect(),
      autoPronunciationEnabled: autoPronunciationEnabled == null
          ? this.autoPronunciationEnabled
          : autoPronunciationEnabled(),
      trainingSize: trainingSize == null ? this.trainingSize : trainingSize(),
      pickedTrainableLexicalItemIds: pickedTrainableLexicalItemIds == null
          ? this.pickedTrainableLexicalItemIds
          : pickedTrainableLexicalItemIds(),
    );
  }
}
